﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace threadState
{
    internal class New : State
    {
        public New()
        {
            StateName = "新建";
        }

        // 使线程从新建状态进入就绪状态
        public void Start(Thread thread)
        {
            Console.Write($"ID 为 {thread.ThreadId} 的线程通过 Start 操作已由");
            Console.Write($"{thread.CurrentState.StateName} 转为");
            thread.CurrentState = new Ready();
            Console.WriteLine($"{thread.CurrentState.StateName}\n");
        }
    }
}
